<template>
  <van-dialog v-model="isShow" :title="titleText" @confirm="confirm">
    <van-field
      v-model="msg"
      rows="1"
      autosize
      type="textarea"
      readonly
    />
  </van-dialog>
</template>

<script>
export default {
  name: 'CustomDialog',
  props: {
    show: {
      type: Boolean,
      required: true,
      default: false
    },
    title: {
      type: String,
      required: true,
      default: ''
    },
    message: {
      type: String,
      required: true,
      default: ''
    }
  },
  computed: {
    isShow: {
      get() {
        return this.show
      },
      set() {
        this.$emit('handleCancel', false)
      }
    },
    titleText: {
      get() {
        return `${this.title}`
      }
    },
    msg: {
      get() {
        return this.message
      }
    }
  },
  mounted() {
    console.log(this.message)
  },
  methods: {
    confirm() {
      this.$emit('handleCancel', false)
    }
  }
}
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
